<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>jquery-jsonp</title>
    <script src="./jquery.min.js" ></script>
    <script >
        function getData() {
            $.ajax({
                url: "http://127.0.0.1/wbs20052/ajax/day02/json.php",
                type: "get",
                dataType: "json",
                data: {},// 请求数据     
                success: function(result){
                    console.log(result);
                },
                error: function(){
                    alert("error");
                }
            });
        }

    </script>
</head>
<body>
    <button onclick="getData()">getData</button>
</body>
</html>